<?php
	error_reporting(E_ALL | E_STRICT);
	ini_set('display_startup_errors', 1);
	ini_set('display_errors', 1);
	
	// Define path to application directory
	defined('APPLICATION_PATH')
	    || define('APPLICATION_PATH', realpath(dirname(__FILE__) . '/../application'));

	// Define application environment
	defined('APPLICATION_ENV')
	    || define('APPLICATION_ENV', (getenv('APPLICATION_ENV') ? getenv('APPLICATION_ENV') : 'production'));	

	/*
	* Setup libraries & autoloaders
	*/
	set_include_path(dirname(__FILE__).'/../library/ZF/'
	    . PATH_SEPARATOR . dirname(__FILE__).'/../library/Doctrine'
	    . PATH_SEPARATOR . dirname(__FILE__).'/models'
	    . PATH_SEPARATOR . dirname(__FILE__).'/models/base'
	    . PATH_SEPARATOR . get_include_path());
	require_once 'Zend/Loader/Autoloader.php';
	
	$autoloader = Zend_Loader_Autoloader::getInstance();
		
	//$autoloader->pushAutoloader(array('Doctrine', 'autoload'), 'Doctrine');
	$autoloader->registerNamespace('sfYaml')->pushAutoloader(array('Doctrine', 'autoload'), 'sfYaml');
	$autoloader->setFallbackAutoloader(true);
	

	/*
	* Set super-global data
	*/
	Doctrine_Manager::connection("mysql://djakson:djakson@localhost/ongame");
	/*
	* Configure Doctrine
	*/
	Zend_Registry::set('doctrine_config', array(
            'data_fixtures_path'  =>  APPLICATION_PATH . '/doctrine/data/fixtures',
            'models_path'         =>  APPLICATION_PATH . '/models',
            'migrations_path'     =>  APPLICATION_PATH . '/doctrine/migrations',
            'sql_path'            =>  APPLICATION_PATH . '/doctrine/data/sql',
            'yaml_schema_path'    =>  APPLICATION_PATH . '/doctrine/schema',
            "generate_models_options" => array(
            'generateBaseClasses'   =>  true,
            'generateTableClasses'  =>  true,
            'generateAccessors'     =>  true,
            'classPrefixFiles'      =>  false,
            'classPrefix'           =>  'Default_Model_',
            'baseClassesDirectory'  =>  'base',
            /*'baseClassPrefixFiles'  =>  false,
            'baseClassPrefix'       => 'Base_',*/
            'baseClassName'         =>  'Doctrine_Record'
        )));
